var numPrice1 = 0;
var numPrice = 0;

function add_data() {
    var id = $("#id").val();
    var DataSources = {
        "orderID": id
    };
    $.ajax({
        url: "findOrderProductByOrderProductData",
        type: "POST",
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        data: JSON.stringify(DataSources),
        success: function (data) {
            if (data.code == 500) {

            } else {
                var code = '';
                for (var i = 0; i < data.orderProduct_list.length; i++) {
                    numPrice = data.orderProduct_list[i].recycleProductEntity.recProductPrice * data.orderProduct_list[i].orderProductNum;
                    numPrice1 += data.orderProduct_list[i].recycleProductEntity.recProductPrice * data.orderProduct_list[i].orderProductNum;
                    code += "                             <div class=\"list-view-layout1\">\n" +
                        "                                                            <div class=\"product-box-layout3\">\n" +
                        "                                                                <div class=\"item-img\">\n" +
                        "                                                                    <a href=web-single-product.html?id=" + data.orderProduct_list[i].recProductID + "><img\n" +
                        "                                                                          style='width: 275px;height: 195px;' src='upload/" + data.orderProduct_list[i].recycleProductEntity.recProductImage + "' alt=\"Product\"></a>\n" +
                        "                                                                </div>\n" +
                        "                                                                <div class=\"product-info\">\n" +
                        "                                                                    <div class=\"item-content\">\n" +
                        "                                                                        <h3 class=\"item-title\"><a href=web-single-product.html?id=" + data.orderProduct_list[i].recProductID + ">" + data.orderProduct_list[i].recycleProductEntity.recProductName + "\n" +
                        "                                                                            </a></h3>\n" +
                        "                                                                        <ul class=\"entry-meta\">\n" +
                        "                                                                            <li><i class=\"far fa-clock\"></i>" + data.orderProduct_list[i].orderProductDate + "</li>\n" +
                        "                                                                            </li>\n" +
                        "                                                                        </ul>\n" +
                        "                                                                        <ul class=\"item-condition\">\n" +
                        " <li><span>废品量:</span> </li>\n" +
                        " <li><span> " + data.orderProduct_list[i].orderProductNum + "</span> </li>\n" +
                        "                                                                        </ul>\n" +
                        "                                                                        <div class=\"btn-group\">\n" +
                        "                                                                        </div>\n" +
                        "                                                                    </div>\n" +
                        "                                                                    <div class=\"item-right\">\n" +
                        "                                                                        <div class=\"item-price\">\n" +
                        "                                                                            <span class=\"currency-symbol\">$</span>\n" +
                        "                                                                          " + numPrice + "\n" +
                        "                                                                        </div>\n" +
                        "                                                                    </div>\n" +
                        "                                                                </div>\n" +
                        "                                                            </div>\n" +
                        "                                                        </div>\n";
                }
                var detail = '';
                detail += "                                                        <div class=\"pagination-layout1\">\n" +
                    "                                                            <div class=\"btn-prev disabled\">\n" +
                    "\n" +
                    "                                                            </div>\n" +
                    "                                                            <div class=\"page-number\">\n" +
                    "\n" +
                    "                                                            </div>\n" +
                    "                                                            <div class=\"btn-next\">\n" +
                    "                                                                <a><i class=\"fas fa-angle-double-right\"></i>总价:<span>" + numPrice1 + "</span></a>\n" +
                    "                                                            </div>\n" +
                    "                                                        </div>";

                $("#data_1").html("");
                $("#data_1").append(code);
                $("#data_1").append(detail);
                numPrice1 = 0;
            }
        }
    });
}

$(function () {
    setTimeout("add_data()", 100);
});